﻿using BLL;
using MODEL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Loginter.驾驶员管理
{
    public partial class DriverBindCar : System.Web.UI.Page
    {
        DriverBLL driverBLL = new DriverBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                truckinfo();
            }
        }

        #region 显示车辆信息
        /// <summary>
        ///显示车辆信息
        /// </summary>
        private void truckinfo()
        {
            //驾驶员姓名
            string name = Request.QueryString["Name"];
            string Teamname = Request.QueryString["TeamName"];
            //当前空闲车辆
            int state = 2;
            if (name == null || Teamname == null)
            {
                Response.Redirect("DriverInfoList.aspx");
            }
            else
            {
                lal_DriveName.Text = name;
                TruckMODEL truckMODEL = new TruckMODEL()
                {
                    TeamName = Teamname,
                    State = Convert.ToString(state)
                };
                List<TruckinfoModel> list = driverBLL.Gettruckinfo(truckMODEL);
                grdv_Driver.DataSource = list;
                grdv_Driver.DataBind();
            }

        }
        #endregion
        protected void btn_false_Click(object sender, EventArgs e)
        {
            Response.Redirect("DriverInfoList.aspx");
        }
    }
}